import { shell } from "electron"
import IpcTemplate from "../core/ipc/ipc-template"
import { constTemplate } from "@/common/constants"
/**
 * https://www.electronjs.org/zh/docs/latest/api/shell
 */
class ShellIpc extends IpcTemplate {
    constructor() {
        super(constTemplate.shell)
    }
    /**
     * 通过外部浏览器打开 链接
     * @param { String } params.url 需要打开的外部连接
     */
    openExternal(params: { url: string }) {
        shell.openExternal(params.url)
    }
}

const shellIpc = new ShellIpc()

export default shellIpc